<template>
    <div class="dialog">
      <!-- 头部 -->
      <div class="dialog-header">
        <!-- 具名插槽：一旦插槽起了名字，就是具名插槽，只支持定向分发 -->
        <slot name="head"></slot>
        <span class="close">✖️</span>
      </div>

      <!-- 内容 -->
      <div class="dialog-content">
        <!-- 1. 在需要定制的位置，使用slot占位 -->
        <!-- <slot>我是后备内容（默认值）</slot> -->
        <slot name="content"></slot>
      </div>

      <!-- 右下角 按钮 底部 -->
      <div class="dialog-footer">
        <!-- <button>取消</button>
        <button>确认</button> -->
        <slot name="footer"></slot>
      </div>

    </div>
  </template>
  
  <script>
  export default {
    data () {
      return {
  
      }
    }
  }
  </script>
  
  <style scoped>
  * {
    margin: 0;
    padding: 0;
  }
  .dialog {
    width: 470px;
    height: 230px;
    padding: 0 25px;
    background-color: #ffffff;
    margin: 40px auto;
    border-radius: 5px;
  }
  .dialog-header {
    height: 70px;
    line-height: 70px;
    font-size: 20px;
    border-bottom: 1px solid #ccc;
    position: relative;
  }
  .dialog-header .close {
    position: absolute;
    right: 0px;
    top: 0px;
    cursor: pointer;
  }
  .dialog-content {
    height: 80px;
    font-size: 18px;
    padding: 15px 0;
  }
  .dialog-footer {
    display: flex;
    justify-content: flex-end;
  }
  .dialog-footer button {
    width: 65px;
    height: 35px;
    background-color: #ffffff;
    border: 1px solid #e1e3e9;
    cursor: pointer;
    outline: none;
    margin-left: 10px;
    border-radius: 3px;
  }
  .dialog-footer button:last-child {
    background-color: #007acc;
    color: #fff;
  }
  </style>